package domfarr.tapestry.pages;

import java.text.Format;

import org.apache.tapestry5.ioc.annotations.Inject;

import domfarr.tapestry.data.DataSource;
import domfarr.tapestry.model.Celebrity;
import domfarr.tapestry.util.Formats;

public class Details {
	private Celebrity celebrity;

	@Inject
	private DataSource dataSource;

	public Celebrity getCelebrity() {
		return celebrity;
	}

	public Format getDateFormat() {
		return Formats.getDateFormat();
	}

	void onActivate(long id) {
		this.celebrity = dataSource.getCelebrityById(id);
	}

	public DataSource getDataSource() {
		return dataSource;
	}

	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}

	public void setCelebrity(Celebrity celebrity) {
		this.celebrity = celebrity;
	}

}
